package JAVASE514;

import java.util.Scanner;

public class JAVAPrime {
    public static void main(String[] argc) {
        System.out.println("请输入一个整数：");
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        boolean flag=true;
        for (int i = 2; i < x / 2; i++) {
            if (x%i==0){
                flag=false;
                System.out.println(x+"不是质数");
                break;
            }
        }
        if(flag){
            System.out.println(x+"是质数");
        }

    }
}